package com.aks.student.career.common.util;

import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;

/**
 * User: tr1a6333
 * Date: 07.06.2012
 * Time: 17:14
 */
public class LogPhaseListener implements PhaseListener {

    public void afterPhase(PhaseEvent event) {
        System.out.println("After: " + event.getPhaseId());
        String page = event.getFacesContext().getViewRoot().getViewId();
        System.out.println("Page: " + page);
    }

    public void beforePhase(PhaseEvent event) {
        System.out.println("Before: " + event.getPhaseId());
    }

    public PhaseId getPhaseId() {
        return PhaseId.ANY_PHASE;
    }


}